package com.zzh.lib.core.block;

/**
 * Created by ZZH on 2022/6/28.
 *
 * @Date: 2022/6/28
 * @Email: zzh_hz@126.com
 * @QQ: 1299234582
 * @Author: zzh
 * @Description: 锁定间隔
 */
public class HBlocker {

    private long interval = 300;
    private long clickTime = 0;

    public long getInterval() {
        return interval;
    }

    public HBlocker setInterval(long interval) {
        this.interval = interval;
        return this;
    }

    public boolean blocker() {
        if ((System.currentTimeMillis() - clickTime) > interval) {
            clickTime = System.currentTimeMillis();
            return false;
        } else {
            return true;
        }
    }
}
